﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Net;
using Keepo.Helpers;
using System.Drawing;

namespace Keepo.Designer.Controllers
{
    public class InfraRenderController : Controller
    {
        public ActionResult RenderProductByIdx(int templateId = 1, int templatePageIdx = 0, int productId = 1, int productPageIdx = 0)
        {
            Bitmap image = RenderHelper.RenderProductByIdx(templateId, templatePageIdx, productId, productPageIdx);
            byte[] byteArray = RenderHelper.BitmapToByteArray(image);
            return File(byteArray, "image/jpeg");
        }
    }
}
